<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>Hello MUI</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<!--标准mui.css-->
		<link rel="stylesheet" href="../css/mui.min.css">
		<link rel="stylesheet" href="../css/iconfont.css">
		<link rel="stylesheet" href="../css/app.css"/>
		<style>
			.mui-content .mui-table-view-cell .iconfont{
				font-size: 20px;
				padding-right:20px;
			}
			.mui-table-view-cell:after{
				/*left:0px;*/
			}
			.mui-content .icon-shezhi{
				color:#999;
			}
			.mui-content .icon-shoucang{
				color:#fea93d;
			}
			.mui-content .icon-2{
				color:#FF0000;
			}
			.mui-content .icon-pinglun{
				color:#8A6DE9;
			}
			.am-header .mui-header-img img{
				width:80px;
				height:80px;
				border-radius: 40px;
			}
			.am-header{
				text-align: center;
				padding:40px 30px;
				background:#fff;
			}
			.mui-header-img,.mui-header-name{
				display: inline-block;
			}
			.mui-table-view{
				background: none;
				margin-top:5px!important;
			}
			.mui-table-view:before,.mui-table-view:after,.mui-table-dingdan:after{
				content:none;
			}
			.mui-table-view-cell{
				background: #fff;
			}
			.mui-table-view-shezhi,.mui-table-view-version{
				margin-top:5px;
			}
			.mui-header-name{
				margin-top:10px;
			}
			.mui-head-top{
				display: inline-block;
			}
			.mui-navigate-face{
				margin:0!important;
				padding:0 0 0 15px!important;
				line-height:60px;
			}
			.mui-navigate-face img{
				width:40px;
				height:40px;
				border-radius: 20px;
			}
			.mui-navigate-face span{
				float: right;
				position:relative;
				right:40px;
				top:10px;
				height:40px;
			}
			.mui-table-face{
				padding:0px!important;
			}
			.mui-navigate-right1 span{
				float: right;
				margin-right:20px;
			}
			.mui-bar-nav~.mui-content{
				padding:0;
				margin-top:44px;
			}
		</style>
	</head>

	<body>
		<div class="mui-bar mui-bar-nav">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		    <h1 class="mui-title">设置</h1>
		</div>
		<div class="mui-content">
			<ul class="mui-table-view mui-table-view-chevron">
				<li class="mui-table-view-cell mui-table-address">
					<a href="#notifications" class="mui-navigate-right">地址管理</a>
				</li>
				<!--<li class="mui-table-view-cell">
					<a href="#privacy" class="mui-navigate-right">隐私</a>
				</li>-->
				<li class="mui-table-view-cell mui-table-clear">
					<a href="#general" class="mui-navigate-right">清理缓存</a>
				</li>
				<li class="mui-table-view-cell mui-table-aboutus">
					<a href="#general" class="mui-navigate-right">关于我们</a>
				</li>
			</ul>
		    
			<ul class="mui-table-view" id="mui_login_out" style="margin-top:10px!important;">
				<li class="mui-table-view-cell" id="mui_table_loginout" style="text-align: center;">
					<a>退出登录</a>
				</li>
			</ul>
		</div>

	</body>

	<script src="../js/mui.min.js"></script>
	<script src="../js/castapp.js"></script>
	<script src="../js/myapp.js"></script>
	<script>
		ca.init();
		//清理缓存
		ca.className('mui-table-clear')[0].addEventListener('tap',function(){
			ca.confirm({
				title:'提示',
				content:'确认清理缓存？',
				callback:function(data){
					if(data){
						ca.prompt('清除成功');
					}
				}
			});
		});
		//关于我们
		ca.className('mui-table-aboutus')[0].addEventListener('tap',function(){
			ca.newInterface({url:'about_us.html',id:"about_us"});
		});
		//地址管理
		ca.className('mui-table-address')[0].addEventListener('tap',function(){
			ca.newInterface({url:'my_address.html',id:"my_address"});
		});
		//用户退出按钮显示
		!get_user_access_token() ? ca.id('mui_login_out').style.display = 'none' : '';
		//登出
		ca.id('mui_table_loginout').addEventListener('tap',function(){
			ca.confirm({
				title:'提示',
				content:'确定要退出吗？',
				callback:function(data){
					if(data){
						//删除用户授权token
						localStorage.removeItem('user_access_token');
						//删除手机
						localStorage.removeItem('user_mobile');
						//删除头像
						localStorage.removeItem('user_avatar');
						//删除昵称
						localStorage.removeItem('user_nicename');
						//删除性别
						localStorage.removeItem('user_sex');
						//删除生日
						localStorage.removeItem('user_birthday');
						ca.sendNotice('pages/home.html','userInfo',{});
						ca.prompt('退出成功');
						setTimeout(function(){
							 ca.closeCurrentInterface();
						},1000);
					}
				}
			});
		});
	</script>
</html>